/**
 * 
 */
package cn.damong.weixin.mp;

import java.io.Serializable;

/**
 * 微信网页端分享时需要的信息
 * 
 * @author CodingPanda
 * @2019年5月8日 下午11:50:40
 *
 */
public class WeixinShareInfo implements Serializable {
    private static final long serialVersionUID = 8461401163841470003L;

    /**
     * 公众号的唯一标识
     */
    private String appId;

    /**
     * 签名时间戳
     */
    private Long timestamp;

    /**
     * 签名随机字符串
     */
    private String nonceStr;

    /**
     * 签名
     */
    private String signature;

    /**
     * 分享出去后看到的标题
     */
    private String title;

    /**
     * 分享的描述，分享给朋友时在标题下面的小字，长度受不同手机屏幕大小的影响
     */
    private String description;

    /**
     * 分享点击打开的链接
     */
    private String shareUrl;

    /**
     * 分享时的缩略图URL
     */
    private String thumbnail;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getNonceStr() {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getShareUrl() {
        return shareUrl;
    }

    public void setShareUrl(String shareUrl) {
        this.shareUrl = shareUrl;
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((appId == null) ? 0 : appId.hashCode());
        result = prime * result + ((description == null) ? 0 : description.hashCode());
        result = prime * result + ((nonceStr == null) ? 0 : nonceStr.hashCode());
        result = prime * result + ((shareUrl == null) ? 0 : shareUrl.hashCode());
        result = prime * result + ((signature == null) ? 0 : signature.hashCode());
        result = prime * result + ((thumbnail == null) ? 0 : thumbnail.hashCode());
        result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode());
        result = prime * result + ((title == null) ? 0 : title.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        WeixinShareInfo other = (WeixinShareInfo) obj;
        if (appId == null) {
            if (other.appId != null) {
                return false;
            }
        } else if (!appId.equals(other.appId)) {
            return false;
        }
        if (description == null) {
            if (other.description != null) {
                return false;
            }
        } else if (!description.equals(other.description)) {
            return false;
        }
        if (nonceStr == null) {
            if (other.nonceStr != null) {
                return false;
            }
        } else if (!nonceStr.equals(other.nonceStr)) {
            return false;
        }
        if (shareUrl == null) {
            if (other.shareUrl != null) {
                return false;
            }
        } else if (!shareUrl.equals(other.shareUrl)) {
            return false;
        }
        if (signature == null) {
            if (other.signature != null) {
                return false;
            }
        } else if (!signature.equals(other.signature)) {
            return false;
        }
        if (thumbnail == null) {
            if (other.thumbnail != null) {
                return false;
            }
        } else if (!thumbnail.equals(other.thumbnail)) {
            return false;
        }
        if (timestamp == null) {
            if (other.timestamp != null) {
                return false;
            }
        } else if (!timestamp.equals(other.timestamp)) {
            return false;
        }
        if (title == null) {
            if (other.title != null) {
                return false;
            }
        } else if (!title.equals(other.title)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "WeixinShareInfo [appId=" + appId + ", timestamp=" + timestamp + ", nonceStr=" + nonceStr
                + ", signature=" + signature + ", title=" + title + ", description=" + description + ", shareUrl="
                + shareUrl + ", thumbnail=" + thumbnail + "]";
    }

}
